#include<bits/stdc++.h>
using namespace std;
char s1[100];


int main()
{
	int n;
	cin>>n;
	for(int j=1;j<=n;j++){
		int c,d;
		cin>>c>>d;
		for(int i=0;i<c;i++)	cin>>s1[i];
		int s=0;
		int a=0;
		int r;
		while(1){
			if(a+d+1>=c-1){
				cout<<"Day #"<<j<<endl;
				cout<<c<<' '<<d<<endl;
				for(int i=0;i<c;i++)	cout<<s1[i];
				cout<<endl;
				cout<<s+1<<endl;
				cout<<endl;
				break; 
			}
			for(int i=a+d+1;i>=a-1;i--){
				if(s1[i]=='.'){
					r=i;
					s++;
					break;
				}
			}
			if(r<a+1){
				cout<<"Day #"<<j<<endl;
				cout<<c<<' '<<d<<endl;
				for(int i=0;i<c;i++)	cout<<s1[i];
				cout<<endl;
				cout<<0<<endl;
				cout<<endl;
				break;
			}
			a=r;
		}
	}
	return 0;	
} 
